/**
 * 
 */
package br.gov.ms.tce.modelo.dao.impl;

import java.util.List;

import javax.inject.Named;

import br.gov.ms.tce.bean.comum.PessoaFisica;
import br.gov.ms.tce.bean.comum.Responsavel;
import br.gov.ms.tce.modelo.dao.ResponsavelDAO;

/**
 * @class ResponsavelDAOJPA
 * @author Anderson Paulino
 * @date 01/06/2011
 *
 */
@Named
public class ResponsavelDAOJPA extends GenericDAOJPA<Responsavel,Integer> implements
		ResponsavelDAO {

	/**
	 * @see br.gov.ms.tce.modelo.dao.ResponsavelDAO#findByPessoa(br.gov.ms.tce.modelo.bean.PessoaFisica)
	 */
	@Override
	public List<Responsavel> findByPessoa(PessoaFisica pessoaFisica) {
		createCriteria();	
		query.select(root).where(cb.equal(root.get("pessoaFisica"), pessoaFisica));		
		return getResultList();		
	}

}
